#ifdef __cplusplus
    #include <cstdlib>
#else
    #include <stdlib.h>
#endif

#include <SDL/SDL.h>

int main ( int argc, char** argv )
{
    int done=1;
    SDL_Event event;
    SDL_Surface *fenetre1;
    freopen("CON","w",stdout);
    freopen("CON","r",stdin);



 if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )

    {
        printf( "Unable to init SDL: %s\n", SDL_GetError() );
        return 1;
    }

    SDL_Surface* screen = SDL_SetVideoMode(640, 480, 16,
                                           SDL_HWSURFACE|SDL_DOUBLEBUF);
    SDL_Surface* bmp = SDL_LoadBMP("ac1.bmp");

    SDL_Rect dstrect;
    dstrect.x = (screen->w - bmp->w) / 2;
    dstrect.y = (screen->h - bmp->h) / 2;

    SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));


    SDL_BlitSurface(bmp, 0, screen, &dstrect);


    SDL_Flip(screen);
         while(done)
         {
             while(SDL_PollEvent(&event))
                {
                 switch(event.type)
                  {case SDL_MOUSEBUTTONDOWN:
                   {int x=event.motion.x;
                   int y=event.motion.y;
                   printf("x=%d",x);
                   printf("Y=%d",y);

                    break;
                   }
                    case SDL_QUIT:
                    done = 0;
                    break;






                  }
                }

         }

    return 0;
}
